import React from 'react';
import styles from './Button.module.less';
import { type ButtonProps, Button } from '@mantine/core';
import classNames from 'classnames';
import { mergeClassNames } from '../tools';

interface ExtendedButtonProps extends ButtonProps {
  onClick?: () => void;
  type?: 'button' | 'submit' | 'reset';
  btnType?: 'primary' | 'secondary' | 'tertiary';
  size?: 'lg' | 'md' | 'xs';
}
export const NButton = React.memo(
  ({ className, btnType = 'primary', size = 'md', ...restProps }: ExtendedButtonProps) => {
    {
      return (
        <Button
          className={classNames('min-w-70 h-44 py-0 px-8 rounded-6', styles[btnType], styles[size], className)}
          classNames={mergeClassNames(styles, restProps.classNames)}
          variant="gradient"
          {...restProps}
        />
      );
    }
  },
);
